fix: Include screenshot attachment in native backend envelope#1624
Merged
tustanivsky merged 6 commits intomasterfrom Apr 2, 2026
Merged
fix: Include screenshot attachment in native backend envelope#1624tustanivsky merged 6 commits intomasterfrom
tustanivsky merged 6 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Collaborator
|
does this fix the screenshot test for native? are we able to remove the skip? sentry-native/tests/test_integration_screenshot.py Lines 43 to 48 in e12743b |
mujacica
approved these changes
Apr 2, 2026
Collaborator
Author
The file-existence test still has to be skipped for native backend since the daemon deletes the run folder after processing the envelope. So basically by the time we check for the file it's already gone. |
jpnurmi
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The native backend's crash daemon captures screenshot out-of-process via
sentry__screenshot_capture()and saves it to{run_folder}/screenshot.png. However, neitherwrite_envelope_with_native_stacktracenorwrite_envelope_with_minidumpincluded this file in the envelope. After the envelope was sent, the run folder was cleaned up deleting the screenshot that was never transmitted.The crashpad and breakpad backends handle this correctly: crashpad passes the screenshot path to
StartHandler()and breakpad explicitly callssentry__envelope_add_attachment().Suggested fix
Both envelope writing functions now check for
screenshot.pngin the run folder and add it via the existingwrite_attachment_to_envelope()helper which gracefully skips missing files. This follows the same pattern used for scope attachments read from the__sentry-attachmentsmetadata file.Related items